package com.zzyl.serve.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.serve.domain.admin.NursingProject;
import com.zzyl.serve.service.admin.INursingProjectService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/member/orders/project")
@Api(tags =  "预约信息相关接口")
public class MemberNursingProjectController extends BaseController {
    @Autowired
    private INursingProjectService nursingProjectService;
    //分页查询护理项目
    //TODO 我们只需要调用之前写过的分页service即可
    @GetMapping("/page")
    public TableDataInfo list(NursingProject nursingProject)
    {
        startPage();
        List<NursingProject> list = nursingProjectService.selectNursingProjectList(nursingProject);
        return getDataTable(list);
    }
    //TODO 根据id查看护理项目,还是调用之前写过的service即可
    @GetMapping("/{id}")

    public R<NursingProject> getById(@PathVariable  Integer id)
    {
        NursingProject nursingProject = nursingProjectService.selectNursingProjectById(id);
        return R.ok(nursingProject);
    }


}
